package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.cloudkinto.enumType.order.SendInEnum;
import com.cloudkinto.enumType.order.inbound.ArrivalModeEnum;
import com.cloudkinto.enumType.order.inbound.InboundTypeEnum;
import com.cloudkinto.enumType.order.inbound.OrderInputStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 到货通知单（订单入库）
 * </p>
 *
 * @author long
 * @since 2024-11-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_order_input")
public class OrderInputDo extends Model<OrderInputDo> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 入库单号
     */
    @TableField("source_no")
    private String sourceNo;

    /**
     * 仓库id
     */
    @TableField("warehouse_id")
    private Long warehouseId;

    @TableField(value = "company_id", fill = FieldFill.INSERT)
    private Long companyId;

    /**
     * 租户id
     */
    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    private Long tenantId;

    /**
     * 到仓方式 {@link ArrivalModeEnum}
     */
    @TableField("arrive_method")
    private Integer arriveMethod;

    /**
     * 物流跟踪号
     */
    @TableField("tracking_number")
    private String trackingNumber;

    /**
     * 参考单号
     */
    @TableField("reference_number")
    private String referenceNumber;

    /**
     * 入库类型 {@link InboundTypeEnum}
     */
    @TableField("inbound_type")
    private Integer inboundType;

    /**
     * 产品数量
     */
    @TableField("sku_total_qty")
    private Integer skuTotalQty;

    /**
     * 已收箱数
     */
    @TableField("receipt_box_qty")
    private Integer receiptBoxQty;

    /**
     * 总箱数
     */
    @TableField("box_total_qty")
    private Integer boxTotalQty;

    /**
     * 已收托盘数
     */
    @TableField("receipt_pallets_qty")
    private Integer receiptPalletsQty;

    /**
     * 预报总托盘数
     */
    @TableField("pallets_total_qty")
    private Integer palletsTotalQty;

    /**
     * 状态 {@link OrderInputStatusEnum}
     */
    @TableField("status")
    private Integer status;

    /**
     * 附件ids
     */
    @TableField("file_ids")
    private String fileIds;

    /**
     * 预计到达日期
     */
    @TableField("expected_date")
    private Date expectedDate;

    /**
     * 预约标识 0普通库存 1预售库存
     */
    @TableField("reserve_flag")
    private Integer reserveFlag;


    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 提交时间
     */
    @TableField("push_wms_time")
    private Date pushWmsTime;

    /**
     * 收货时间
     */
    @TableField("receipt_time")
    private Date receiptTime;

    /**
     * 上架时间
     */
    @TableField("shelf_time")
    private Date shelfTime;

    /**
     * 取消时间
     */
    @TableField("canceled_time")
    private Date canceledTime;

    /**
     * 订单创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建人
     */
    @TableField(value = "create_by_name", fill = FieldFill.INSERT)
    private String createByName;
    /**
     * 创建人
     */
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 推送到代理仓 0 不需要推送 1 未推送 2 已推送 3 推送失败
     * {@link SendInEnum}
     */
    @TableField("send_in")
    private Integer sendIn;

    /**
     * 推送失败原因
     */
    @TableField("send_in_fail_msg")
    private String sendInFailMsg;

    /**
     * 是否api执行过sku收货并上架
     */
    @TableField("api_sku_accept_flag")
    private Boolean apiSkuAcceptFlag;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
